export const fields = [
    {
        "dataIndex": "id",
        "title": "id"
    },
    {
        "dataIndex": "addressCounty",
        "title": "地址_县",
        type: 'input'
    },
    {
        "dataIndex": "addressTownship",
        "title": "地址_乡",
        type: 'input'
    },
    {
        "dataIndex": "administrativeArea",
        "title": "行政区域面积"
    },
    {
        "dataIndex": "appleSownArea",
        "title": "苹果播种面积"
    },
    {
        "dataIndex": "bananaSownArea",
        "title": "香蕉播种面积"
    },
    {
        "dataIndex": "beetSownArea",
        "title": "甜菜播种面积"
    },
    {
        "dataIndex": "citrusSownArea",
        "title": "柑桔播种面积"
    },
    {
        "dataIndex": "contactPhone",
        "title": "联系电话"
    },
    {
        "dataIndex": "cornSownArea",
        "title": "玉米播种面积"
    },
    {
        "dataIndex": "cottonSownArea",
        "title": "棉花播种面积"
    },
    {
        "dataIndex": "fillingInstructions",
        "title": "填写说明"
    },
    {
        "dataIndex": "flueCuredTobaccoSownArea",
        "title": "烤烟播种面积"
    },
    {
        "dataIndex": "formFiller",
        "title": "填表人"
    },
    {
        "dataIndex": "grapeSownArea",
        "title": "葡萄播种面积"
    },
    {
        "dataIndex": "highlandBarleySownArea",
        "title": "青稞播种面积"
    },
    {
        "dataIndex": "jujubeSownArea",
        "title": "红枣播种面积"
    },
    {
        "dataIndex": "medicinalCropsSownArea",
        "title": "药材播种面积"
    },
    {
        "dataIndex": "melonSownArea",
        "title": "甜瓜播种面积"
    },
    {
        "dataIndex": "peanutSownArea",
        "title": "花生播种面积"
    },
    {
        "dataIndex": "pearSownArea",
        "title": "梨播种面积"
    },
    {
        "dataIndex": "persimmonSownArea",
        "title": "柿子播种面积"
    },
    {
        "dataIndex": "pineappleSownArea",
        "title": "菠萝播种面积"
    },
    {
        "dataIndex": "potatoSownArea",
        "title": "马铃薯播种面积"
    },
    {
        "dataIndex": "rapeseedSownArea",
        "title": "油菜籽播种面积"
    },
    {
        "dataIndex": "reportDate",
        "title": "报出日期"
    },
    {
        "dataIndex": "riceSownArea",
        "title": "水稻播种面积"
    },
    {
        "dataIndex": "sorghumSownArea",
        "title": "高粱播种面积"
    },
    {
        "dataIndex": "soybeanSownArea",
        "title": "大豆播种面积"
    },
    {
        "dataIndex": "specialCropsTypes",
        "title": "特色农作物种类",
        type: 'input'
    },
    {
        "dataIndex": "statisticsResponsiblePerson",
        "title": "统计负责人"
    },
    {
        "dataIndex": "strawberrySownArea",
        "title": "草莓播种面积"
    },
    {
        "dataIndex": "sugarcaneSownArea",
        "title": "甘蔗播种面积"
    },
    {
        "dataIndex": "sweetPotatoSownArea",
        "title": "甘薯播种面积"
    },
    {
        "dataIndex": "teaSownArea",
        "title": "茶叶播种面积"
    },
    {
        "dataIndex": "tobaccoSownArea",
        "title": "烟叶播种面积"
    },
    {
        "dataIndex": "totalCropsSownArea",
        "title": "农作物总播种面积"
    },
    {
        "dataIndex": "unitResponsiblePerson",
        "title": "单位负责人"
    },
    {
        "dataIndex": "vegetableSownArea",
        "title": "蔬菜播种面积"
    },
    {
        "dataIndex": "verificationStatus",
        "title": "核实状态"
    },
    {
        "dataIndex": "watermelonSownArea",
        "title": "西瓜播种面积"
    },
    {
        "dataIndex": "wheatSownArea",
        "title": "小麦播种面积"
    },
    {
        "dataIndex": "xq",
        "title": "详情"
    }
]

export const getFields = (names = []) => {
    const cols = names.map(name => {
        const fieldItem = fields.find(f => f.title === name);
        if (!fieldItem) {
            console.error(name);
        }
        return fieldItem;
    }).filter(item => {
        if (!item) {
            return false;
        }
        return true
    })
    return cols;
}